<%@ page language="java" pageEncoding="utf-8" import="java.util.*"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>讨论区列表</title>
<%@ include file="/common/meta.jsp"%>
</head>
<body class="border" bgcolor="">
<table width="90%" border="0" align="center">
	<tr>
		<td align="center"><%@ include file="/common/header.jsp"%>
		</td>
	</tr>
	<tr>
		<td>
		<table cellspacing="0" cellpadding="10" width="100%" align="center"
			border="0">
			<tr>
				<td width="100%"></td>
			</tr>
			<tr>
				<td><span class="mainmenu"> <c:choose>
					<c:when test="${me != null}">欢迎!![${me.username}]
	<a href="${ctx}/index.action?method:logout">退出</a>
					</c:when>
					<c:otherwise>
						<a id="backtosite" href="${ctx }/register.jsp">注册</a>
						<a href="${ctx }/loginon.jsp">登陆</a>
					</c:otherwise>
				</c:choose></span></td>
			</tr>
			<tr>
				<td>
				<table cellspacing="0" cellpadding="10" width="100%" align="center"
					border="0">
					<tr>
						<td valign="top">
						<table class="forumline" width="100%" cellspacing="1"
							cellpadding="2" border="0">
							<tbody>
								<tr>
									<th class="thcornerl" colspan="2" width="500">讨论区</th>
									<th class="thtop" width="50">主题数</th>
									<th class="thtop" width="50">发帖数</th>
									<th class="thcornerr">最新发帖</th>
								</tr>
								<c:forEach var="category" items="${categories}"
									varStatus="status">
									<tr>
										<td class="catleft" colspan="2">${category.categoryName }</td>
										<td class="catright" colspan="3"></td>
									</tr>
									<c:forEach var="forum" items="${category.forums}"
										varStatus="status">
										<s:url id="topicListUrl" action='forumadmin'
											includeParams="none">
											<s:param name="method:listTopics"></s:param>
											<s:param name="forumId">${forum.id}</s:param>
										</s:url>
										<tr>
											<td class="row2" width="110"><img alt="[Folder]"
												src="${ctx }/images/folder_big.gif" /></td>
											<td class="row2"><span class="forumlink"
												title="${forum.description}"><a
												href="${topicListUrl }">${forum.forumName }</a></span></td>
											<td class="row2" width="110">${forum.numberCount}</td>
											<td class="row2" width="110"></td>
											<td class="row2" width="110"></td>
										</tr>
									</c:forEach>
								</c:forEach>
							</tbody>
						</table>
						</td>
					</tr>
				</table>
				</td>
			</tr>
			<tr valign="bottom">
				<td><c:if test="${me.username == 'admin'}">
					<a href="${ctx}/forumadmin.action?method:categoriesList">进入后台管理</a>
				</c:if></td>
			</tr>
			<tr>
				<td><%@ include file="/common/footer.jsp"%></td>
			</tr>
		</table>
		</td>
	</tr>
</table>
</body>
</html>